package com.example.db.entity;

import cn.hutool.core.util.IdUtil;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

/**
 * @author L.xf
 * @date 2021/10/27
 */
@Entity
@Table(name = "t_item")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Item extends BaseEntity {

    private String name;
    private BigDecimal price;


    public static List<Item> createItems() {
        int size = 100000;
        List<Item> items = new ArrayList<>(size);
        for (int i = 0; i < size; i++) {
            Item item = new Item("商品 " + i + "号", BigDecimal.valueOf(100.00d));
            items.add(item);
        }
        return items;
    }
}
